package com.aya.ite.component;

import java.util.Iterator;

public class AbstractMenu implements Menu {
    @Override
    public String getName() {
        throw new UnsupportedOperationException();
    }

    @Override
    public String getDescription() {
        throw new UnsupportedOperationException();
    }

    @Override
    public Long getPrice() {
        throw new UnsupportedOperationException();
    }

    @Override
    public String getVegetarian() {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean addMenu(Menu menu) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Iterator<Menu> createIterator() {
       throw new UnsupportedOperationException();
    }

    @Override
    public void print() {
        System.out.println("menu name:\t"+getName());
        Iterator<Menu> iterator = createIterator();
        while (iterator.hasNext()){
            Menu menuItem = iterator.next();
            if(menuItem instanceof  MenuComponent){
                menuItem.print();
               continue;
            }
            System.out.print(menuItem.getName()+"\t");
            System.out.print(menuItem.getDescription()+"\t");
            System.out.print(menuItem.getPrice()+"\t");
            System.out.print(menuItem.getVegetarian()+"\n");
        }
    }

}
